<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "https://raw.githubusercontent.com/rbatis/rbatis/master/rbatis-codegen/mybatis-3-mapper.dtd">
<mapper>
  <select id="select_role_id_by_user_id">
    `select sur.* from sys_user_role sur inner join sys_role sr on sur.role_id = sr.role_id`
    <where>
      `sr.del_flag = 0 and sr.status = 0 and sur.user_id = #{user_id}`
    </where>
  </select>
  <delete id="del_by_role_and_user_id">
    `delete from sys_user_role`
    <where>
      `user_id in ( ${user_id} ) and role_id = #{role_id}`
    </where>
  </delete>
  <delete id="del_by_role_and_user_id_more">
    `delete from sys_user_role`
    <where>
      `user_id in ( ${user_id} ) and role_id = #{role_id}`
    </where>
  </delete>
</mapper>